package com.feige.pojo.vo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import java.util.List;
@ApiModel(value="DeptVo对象", description="减少转给前端的数据量")
public class BaseDeptVo {

    @ApiModelProperty(value = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @NotBlank(message = "部门名称不能为空")
    @ApiModelProperty(value = "部门名称")
    private String deptName;

    @ApiModelProperty(value = "父部门ID")
    private Long pid;

    @ApiModelProperty(value = "下级")
    @TableField(exist = false)
    private List<BaseDeptVo> children;

    public BaseDeptVo() {
    }

    public BaseDeptVo(Long id, String deptName, Long pid, List<BaseDeptVo> children) {
        this.id = id;
        this.deptName = deptName;
        this.pid = pid;
        this.children = children;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Long getPid() {
        return pid;
    }

    public void setPid(Long pid) {
        this.pid = pid;
    }

    public List<BaseDeptVo> getChildren() {
        return children;
    }

    public void setChildren(List<BaseDeptVo> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "BaseDeptVo{" +
                "id='" + id + '\'' +
                ", deptName='" + deptName + '\'' +
                ", pid='" + pid + '\'' +
                ", children=" + children +
                '}';
    }
}
